package com.ys.homework;

/**
 * @author CodeYang
 * @Description TODO
 * @Date 2020/12/14 19:56
 */
public class Circle {
    double r;

    public Circle() {
    }

    public Circle(double r) {
        this.r = r;
    }

    /**
     * 计算圆的面积
     * (PI*r)^2
     */
    void getArea() {
        System.out.println("圆的面积为:" + Math.pow(Math.PI * r, 2));
    }

    /**
     * 获得周长
     * 2*PI*r
     */
    void getPerimeter(){
        System.out.println("圆的周长:"+2*Math.PI*r);
    }
}
